from rest_framework import serializers
from .models import *


class CateSer(serializers.ModelSerializer):  # 分类序列化
    class Meta:
        model = CateModel
        fields = '__all__'

    cate_img = serializers.ImageField(use_url=False)  # 图片前不加前缀


class PictureSer(serializers.ModelSerializer):  # 轮播图序列化
    class Meta:
        model = PictureModel
        fields = '__all__'

    picture = serializers.ImageField(use_url=False)  # 图片前不加前缀


class GoodsSer(serializers.ModelSerializer):  # 商品表
    class Meta:
        model = GoodsModel
        fields = '__all__'

    goods_img = serializers.ImageField(use_url=False)


class UserSer(serializers.ModelSerializer):  # 注册
    class Meta:
        model = UserModel
        fields = '__all__'
